{include file="public/head"}

<body>
    <div class="dressCard">
        <!-- <a href="/index/goods/goodsInfo?id=1">
            <img src="__STATIC__/home/img/img6.png" alt="图片丢失" class="dressCard-left" />
            <div class="dressCard-right">
                <div class="dressCard-right-one">
                    <span>小汽车自动挡</span>
                    <span>C2</span>
                </div>
                <div class="dressCard-right-two">
                    1000人已报名
                </div>
                <div class="dressCard-right-three">
                    <div class="dressCard-right-three-left floatLeft">
                        <div class="floatLeft redCol">￥3970</div>
                    </div>
                    <div class="dressCard-right-three-right floatRight">去报名</div>
                </div>
            </div>
        </a> -->
    </div>
    <div class="clickMore">
        查看更多
    </div>
    <script src="__STATIC__/home/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC__/home/js/public.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function () {
            var heg = $(window).height();
            $("body").css("min-height", heg);
            $("body").css("background-color", "#f9f9f9");
            var page = 1;
            var limit = 10;
            var is_home = 0;
            // 商品列表接口
            requestList();
            function requestList() {
                $.ajax({
                    type: 'post',
                    url: '/index/goods/goodsListData',
                    data: {
                        page,
                        limit,
                        is_home
                    },
                    success(res) {
                        if (res.code == 1) {
                            var list = res.data || [];
                            var html = '';
                            list.forEach(function (item) {
                                if (item.assemble) {
                                    html += `
									<a href="/index/assemble/assembleInfo?id=${item.id}">
										<img src="${item.image}" alt="图片丢失" class="dressCard-left"/>
										<div class="dressCard-right">
											<div class="dressCard-right-one">
												<span>${item.good_name}</span>
											</div>
											<div class="dressCard-right-two">
												${item.subscription}人已报名
											</div>
											<div class="dressCard-right-three">
												<div class="dressCard-right-three-left floatLeft">
													<div class="floatLeft">
														<span class="redCol">${item.assemble.number}</span>人团
													</div>
													<div class="floatLeft"></div>
													<div class="floatLeft redCol">￥${item.assemble.a_price}</div>
													<div class="floatLeft">
													</div>
												</div>
												<div class="dressCard-right-three-right floatRight">去参团</div>
											</div>
										</div>
									</a>
                                `;
                                } else {
                                    html += `
                                    <a href="/index/goods/goodsInfo?id=${item.id}">
                                        <img src="${item.image}" alt="图片丢失" class="dressCard-left" />
                                        <div class="dressCard-right">
                                            <div class="dressCard-right-one">
                                                <span>${item.good_name}</span>
                                            </div>
                                            <div class="dressCard-right-two">
                                                ${item.subscription}人已报名
                                            </div>
                                            <div class="dressCard-right-three">
                                                <div class="dressCard-right-three-left floatLeft">
                                                    <div class="floatLeft redCol">￥${item.price}</div>
                                                </div>
                                                <div class="dressCard-right-three-right floatRight">去报名</div>
                                            </div>
                                        </div>
                                    </a>
                                `;
                                }
                            });
                            $('.dressCard').append(html);
                        } else {
                            $('.clickMore').text('暂无更多数据');
                        }
                    },
                    error() {
                        console.log('商品列表接口错误');
                    }
                })
            };
            // clickMore
            $('.clickMore').click(function () {
                page++;
                requestList();
            });
        });
    </script>
</body>

</html>